package cn.study.jointest;

/**
 * @Author     ：跟大佳一起学架构(java)
 * @Description：Join
 */
public class MyJoin {
    public static void main(String[] args) {
        final Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程1");
            }
        },"t1");
        final Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    t1.join();
                } catch (Exception e) {
                    e.printStackTrace();
                }
                System.out.println("线程2");
            }
        },"t2");
        final Thread t3 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    t2.join();
                }catch (Exception e){
                    e.printStackTrace();
                }
                System.out.println("线程3");
            }
        },"t3");
            t3.start();
            t2.start();
            t1.start();

    }
}
